#include "BPEIrrlichtPhysicsObject.h"
BPEIrrlichtPhysicsObject::BPEIrrlichtPhysicsObject():BPEPhysicsObject(){};
BPEIrrlichtPhysicsObject::BPEIrrlichtPhysicsObject(ISceneNode *n,const double &mass, const bool& physicsOn):BPEPhysicsObject(mass,physicsOn){
	this->node = n;
}


BPEVector3d BPEIrrlichtPhysicsObject::getPosition(){	
	vector3df temp= node->getAbsolutePosition();

	BPEVector3d result(temp.X,temp.Y,temp.Z);

	return result;	

};
void BPEIrrlichtPhysicsObject::setPosition(BPEVector3d pos){ 

	BPEPoint3d temp = pos.getHead();

	vector3df position(temp.getX(),temp.getY(),temp.getZ());

	node->setPosition(position);
	node->updateAbsolutePosition();
};
BPEVector3d BPEIrrlichtPhysicsObject::getRotation(){
	vector3df tempRot = node->getAbsoluteTransformation().getRotationDegrees();
	return BPEVector3d(tempRot.X,tempRot.Y,tempRot.Z);
	
};
void BPEIrrlichtPhysicsObject::setRotation(BPEVector3d rot){
	
	BPEPoint3d rotation = rot.getHead(); 
	node->setRotation(vector3df(rotation.getX(),rotation.getY(),rotation.getZ()));
	node->OnAnimate(1);
};



ISceneNode* BPEIrrlichtPhysicsObject::getNode(){
	return this->node;	
	
};